package com.woniu.cq.mallcommon.controller;


import com.woniu.cq.mallcommon.common.RandomUtil;
import com.woniu.cq.mallcommon.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author daniel
 * @since 2020-09-19
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private SmsService smsService;

    @GetMapping("/getCode")
    public String getCode(String  mobile) {
        String code = RandomUtil.randomCode(6);
        smsService.send(mobile,code);

        return code;
    }



}

